package com.example.node.utils;

import android.content.Context;
import android.graphics.Point;
import android.view.Display;
import android.view.WindowManager;
import static android.content.Context.WINDOW_SERVICE;

public class ScreenUtils {

    public static int getWidth(Context mContext){
        WindowManager wm= (WindowManager) mContext.getSystemService(WINDOW_SERVICE);
        Display display=wm.getDefaultDisplay();
        Point point=new Point();
        if(VersionUtils.isJELLY_BEAN_MR1()){
            display.getRealSize(point);
        }else {
            display.getSize(point);
        }
        return point.x;
    }

    public static int getHeigth(Context mContext){
        WindowManager wm= (WindowManager) mContext.getSystemService(WINDOW_SERVICE);
        Display display=wm.getDefaultDisplay();
        Point point=new Point();
        if(VersionUtils.isJELLY_BEAN_MR1()){
            display.getRealSize(point);
        }else {
            display.getSize(point);
        }
        return point.y;
    }
}
